package com.study.a05tcpdemo1;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {

        //创建socket对象
        Socket socket= new Socket("127.0.0.1",9000);

        //获取输出流
        OutputStream os=socket.getOutputStream();

        os.write("你好".getBytes());

        //关闭流
        os.close();
        //关闭socket
        socket.close();
    }
}
